-
-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C extension #97
base: master
Are you sure you want to change the base?
C extension #97
Conversation
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## master #97 +/- ##
=============================================
- Coverage 100.00% 96.41% -3.59%
- Complexity 184 219 +35
=============================================
Files 17 19 +2
Lines 526 641 +115
=============================================
+ Hits 526 618 +92
- Misses 0 23 +23
☔ View full report in Codecov by Sentry. |
…tely to C. Thanks a lot to ChatGPT for tremendous helpwith Zend API.
This is the first (at least publicly available 😁) working iteration of jsonmachine php extension. Its primary goal for the time being is to accelerate the most called PHP code by replacing it with c implementation. It currently implements only a single function which just simply parses JSON tokens. Its algorithm is basically mirrored from its PHP counterpart which is not optimal. Yet thanks to it the whole lib performs about 2x as fast as without it. With JIT enabled it's only about 1.6 times faster. There is tremendous potential though. This is my longest C code ever written and my first experiment with writing a PHP extension. Any feedback is welcome. It would be ideal to test it on some real and large datasets if anyone is interested. Valrgind says all memory leaks are fixed. If anyone is into C or better yet into Zend C API, feel free to suggest improvements.
Run
make ext-build-debug
to make debug build of the C extensionmake ext-build
to make a production build of the C extensionmake build
(complete build) before pushing - it's run via github actions anyway